package _250312;

import java.util.PriorityQueue;
import java.util.Scanner;

public class _250312 {
	public static void main(String[] args) {
		java.util.Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Long k=sc.nextLong();
		Long[] arr=new Long[n];
		Long count=(long) 0;
		PriorityQueue<Long> heap=new PriorityQueue<>((a,b)->{
			return (int) (b-a);});
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextLong();
			if(arr[i]%2==0) {
				heap.add(arr[i]);
			}
			count+=arr[i];
		}
		while(!heap.isEmpty()&&k-->0) {
			Long ret=heap.peek();
			heap.remove(ret);
			count-=(Long)ret/2;
			
			if(ret%2==0) {
				heap.add(ret/2);
				
			}
		}
	System.out.println(count);
	}
}
